package com.kefu.robot.vo;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.kefu.common.context.KefuContext;
import com.kefu.common.vo.AbstractSearchVo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@ApiModel(description = "智能学习")
public class RobotStudySearchVo extends AbstractSearchVo {


    @ApiModelProperty(name = "createTimeStart", value = "创建时间开始")
    private Long createTimeStart;

    @ApiModelProperty(name = "createTimeEnd", value = "创建时间结束")
    private Long createTimeEnd;


    public <T>QueryWrapper<T> builder() {
   		QueryWrapper<T> wrapper=Wrappers.query();

        //创建时间
        if (createTimeStart != null) {
            wrapper.ge("create_time", createTimeStart);
        }
        if (createTimeEnd != null) {
            wrapper.le("create_time", createTimeEnd);
        }


        wrapper.eq("tenant_id", KefuContext.getKefuContext().getTenantId());

        return wrapper;

    }

}